home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
prgtools
/
gnustuff
/
minix
/
libsrc~1.z
/
libsrc~1
/
ffs.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-12-28
|
242 b
|
22 lines
#include "lib.h"
/* ffs(3)
*
* Author: Terrence W. Holm Sep. 1988
*/
int ffs( word )
int word;
{
int i;
if ( word == 0 )
return( 0 );
for ( i = 1; ; ++i, word >>= 1 )
if ( word & 1 )
return( i );
}